/*******************************************************************************
* Purpose: State-level employment rate for participating states
* 
* Dependencies:
*   Input: Excel spreadsheet with unemployment rates
*		   Retrieved from: https://www.icip.iastate.edu/tables/employment/unemployment-states
*   Output: Stata file with employment rates for each participating state
*
* Notes: -
*******************************************************************************/
set more off
clear all

global storage: env storage

import excel "$storage/ece_parenting/us_1985/emp-unemployment.xls", ///
	   cellrange(A6) sheet("States") firstrow clear

drop Fips
keep Area H

rename H unemployment_1985

# delimit
keep if Area == "Arkansas" | Area == "Connecticut" | Area == "Massachusetts" |
		Area == "Florida" | Area == "New York" | Area == "Texas" | 
		Area == "Pennsylvania" | Area == "Washington" ;
# delimit cr

gen employment = 100 - unemployment_1985

// change state variable for merge
gen site = Area
replace site = "ARK" if site == "Arkansas"
replace site = "EIN" if site == "New York" 
replace site = "HAR" if site == "Massachusetts" 
replace site = "MIA" if site == "Florida" 
replace site = "PEN" if site == "Pennsylvania" 
replace site = "TEX" if site == "Texas" 
replace site = "WAS" if site == "Washington" 
replace site = "YAL" if site == "Connecticut" 

drop Area unemployment_1985

rename *, upper

cd $storage/ece_parenting/
capture mkdir "intermediate_data/"
capture mkdir "intermediate_data/us_1985"
save "$storage/ece_parenting/intermediate_data/us_1985/employment.dta"
